package gui;

import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.JCheckBox;
import javax.swing.JButton;
import javax.swing.UIManager;
import javax.swing.border.LineBorder;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class VBusqueda extends JPanel {
	private JTextField txtTextoABuscar;
	private JCheckBox chckbxTema;
	/**
	 * Create the panel.
	 */
	public VBusqueda() {
		setBorder(new LineBorder(new Color(0, 0, 0)));
		
		txtTextoABuscar = new JTextField();
		txtTextoABuscar.setText("Texto a buscar");
		add(txtTextoABuscar);
		txtTextoABuscar.setColumns(10);
		
		chckbxTema = new JCheckBox("Tema");
		add(chckbxTema);
		
		JButton btnBuscar = new JButton("Buscar");
		btnBuscar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				//System.out.println("Buscando: \""+txtTextoABuscar.getText()+"\" por "+(chckbxTema.isSelected()?"Tema.":"Titulo."));
				((Cabecera)getParent()).getFrame().buscar(txtTextoABuscar.getText(),chckbxTema.isSelected());
			}
		});
		add(btnBuscar);

	}

}
